<%--
 *  File:    AdvancedConditionDetail.jsp
 *  @Author: KentZhong
 *  Date:    2008-11-18 11:02
 *
 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>
<%@ page import="java.util.*,com.oval.foundation.metadata.engine.*" %>
<%@ page import="com.oval.foundation.container.VTableContainer" %>
<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
String strModuleName = "PCM";
  //init param
  Category cat = Category.getInstance("jsp.ConditionDetail");
   %>



<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>

<html>
<head>
<title></title>
<PageFlow:CheckPageFlow pageName="p_viewtablestructure"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="../../css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript">


</script>

</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" cellspacing="0">
 <table width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td class="summary_top"></td>
  </tr>
</table>
<table width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top"><img src="../../images/<%= strLanguageCode %>/quote.gif">  <%= label.getLabelName("L_TableName") %><%= label.getLabelName("L_Colon") %><custom:write name="conditioninfo" property="conditiontypename"/><%= label.getLabelName("L_LeftBracket") %><custom:write name="conditioninfo" property="transtable"/><%= label.getLabelName("L_RightBracket") %> </td>
  </tr>
    <tr>
      <td valign="top">
        <table border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" align="center" width="100%" cellpadding="0">
          <tr class="deepblue-left">
            <td class="title_center" width="8%" ><%= label.getLabelName("L_Sequence") %></td>
            <td class="title_center" width="8%" ><%= label.getLabelName("L_FieldName") %></td>
            <td class="title_center" ><%= label.getLabelName("L_TableAliasName") %></td>
            <td class="title_center" width="15%" ><%= label.getLabelName("L_FieldAliasName") %></td>
            <td class="title_center" ><%= label.getLabelName("L_FieldType") %></td>
            <td class="title_center" ><%= label.getLabelName("L_TableName") %></td>
            <td class="title_center" ><%= label.getLabelName("L_Usable") %></td>
          </tr>
          <%
          HashMap conditioninfo=(HashMap)pageContext.getAttribute("conditioninfo");
          if(conditioninfo!=null)
          {
            String strName=(String)conditioninfo.get("transtable");
            if(strName!=null)
            {
              OvalVTable vtable = (OvalVTable)(VTableContainer.findVTableMeta(strName));
              Iterator it = vtable.getFromTables();
              HashMap mapTable=new HashMap();
              while(it.hasNext())
              {
                OvalFromTable oft = (OvalFromTable)(it.next());
                mapTable.put(oft.getTableAlias(),oft.getTableName());
              }
              it = vtable.getColumnNames();
              int i=0;
              while(it.hasNext())
              {
                i++;
                OvalColumn oc = vtable.getColumnByName(it.next().toString());
          %>
          <tr>
            <td  ><%= i %></td>
            <td  ><%=JspHelper.filterNull( oc.getColName())%></td>
            <td  ><%=JspHelper.filterNull( oc.getColTableAlias())%></td>
            <td  ><%=JspHelper.filterNull( oc.getColDesc())%></td>
            <td  ><%=JspHelper.filterNull( oc.getColType())%></td>
            <td  ><%=JspHelper.filterNull( mapTable.get(oc.getColTableAlias()))%></td>
            <td  ><%=JspHelper.filterNull( oc.getIsUsable())%></td>
          </tr>
              
          <%    
              }
            }
          }%>
        </table>
     </td>
   </tr>
 </table>
</body>
</html>         
